﻿#ifndef FPROGRESSBAR_H
#define FPROGRESSBAR_H

#include <QProgressBar>
#include <QPropertyAnimation>
#include <QTimer>

class FProgressBar : public QProgressBar
{
    Q_OBJECT
    Q_PROPERTY(double lightPos READ lightPos WRITE setLightPos)

public:
    explicit FProgressBar(QWidget *parent = nullptr);

    double lightPos() const { return m_lightPos; }
    void setLightPos(double pos);

    void setLightAnimEnabled(bool en);

protected:
    void paintEvent(QPaintEvent *event) override;

private:
    bool m_animEn = true;

    double m_lightPos;
    QPropertyAnimation *m_lightAnim;
};

#endif // FPROGRESSBAR_H
